package com.qf.config;

import com.qf.interceptor.LoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Component
public class LoginInterceptorConfig implements WebMvcConfigurer {
    @Autowired
    LoginInterceptor loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor)
                .addPathPatterns("/role/**","/revisit/**","/recycle/**","/expenditure/**","/degassing/**","/book/**","/user/**","/patient/**")
                .excludePathPatterns("/user/login","/user/logout","/patient/register","/patient/login","/patient/logout");
    }
}
